home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 121
/
FreelogMagazineJuilletAout2014-No121.iso
/
Outils
/
Adobe-Air
/
adobe-air_13.exe
/
[0]
/
setup.swf
/
scripts
/
LocalizationManager.as
< prev
next >
Wrap
Text File
|
2014-03-27
|
2KB
|
59 lines
package
{
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;
public class LocalizationManager
{
private static var instance:LocalizationManager;
public var defaultResourceBundleName:String = "";
private var resourceManager:IResourceManager;
public function LocalizationManager()
{
super();
if(instance)
{
throw new Error("Error. LocalizationManager is a singleton. Use getInstance() instead.");
}
this.resourceManager = ResourceManager.getInstance();
}
public static function getInstance() : LocalizationManager
{
if(!instance)
{
instance = new LocalizationManager();
}
return instance;
}
public function get localeChain() : Array
{
return this.resourceManager.localeChain;
}
public function getString(param1:String, param2:String = null, param3:Array = null, param4:Boolean = true) : String
{
if(!param1)
{
return "";
}
if(!param2)
{
param2 = this.defaultResourceBundleName;
}
var _loc5_:* = this.resourceManager.getString(param2,param1,param3);
if(param4 && (!_loc5_ || _loc5_.length == 0))
{
_loc5_ = "|" + param1 + "|" + param2 + "|";
}
return _loc5_;
}
}
}